package Test;

import com.config.MyBatisConfig;
import com.config.SpringConfig;
import com.domain.Log;
import com.service.LogService;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes={SpringConfig.class, MyBatisConfig.class})
public class LogServiceTest {

    @Autowired
    private LogService logService;

    public void addLog(){
        Log log=new Log();
        log.setUser_id(1);
        log.setUser_name("admin");
        System.out.println(logService.addLog(log));
    }
}
